from ultralytics import YOLO

model = YOLO("runs\\detect\\train6\\weights\\best.pt")
results = model.predict("D:\\神经网络数据集\\头盔检测\\数据集1\\Safety Helmet Detection_datasets\\images\\train\\hard_hat_workers16.png", save=True)
results = model.predict("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000219.jpg", save=True)
results = model.predict("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000246.jpg", save=True)
results = model.predict("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000250.jpg", save=True)
print(results)